# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>

pkgname=libslirp
pkgver=4.7.0
pkgrel=1
pkgdesc='General purpose TCP-IP emulator'
arch=(loong64 x86_64)
url='https://gitlab.freedesktop.org/slirp/libslirp'
license=(BSD MIT)
depends=(glib2)
makedepends=(meson)
provides=('libslirp.so')
source=("${url}/-/archive/v${pkgver}/libslirp-v${pkgver}.tar.gz")
sha512sums=('387f4a6dad240ce633df2640bb49c6cb0041c8b3afc8d0ef38186d385f00dd9e4ef4443e93e1b71dbf05e22892b6f2771a87a202e815d8ec899ab5c147a1f09f')
b2sums=('f3e1c3a31f09462d79ca6c663a05bde02b075090f3a5f7bc69fef3c72b8517c11a123ad7b46f4b2855cbc9a7a5dbde8d1cb2d5e3e2a9d7eedbe570c200f8bcc6')

build() {
  arch-meson "$pkgname-v${pkgver}" build
  ninja -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build
  install -vDm 644 "$pkgname-v${pkgver}"/COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
